| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Cmd
Description
The module to handle all comands entered at the console. Info: For simplicitie's sake the files matching the rawEnding of the settings are calleds raw files and the files matching the jpegEnding are called jpeg files even they could have any ending and could be files of any type.
- cmdMain :: IO ()
- inputHandler :: (PhotoSetting, String) -> IO ()
- handleCommand :: (String, String) -> PhotoSetting -> IO (PhotoSetting, String)
- toTuple :: String -> (String, String)
- stringToBool :: String -> Bool
- uniformFilePath :: String -> String
- uniformFileExtension :: String -> String
- formatPhotoFileList :: [PhotoFile] -> String
Documentation
Arguments
| :: (PhotoSetting, String) | Tuple containing the current settings of the program and an input string. |
| -> IO () | An empty io monade. |
Handles the user input by reading a line from the console recursively.
Arguments
| :: (String, String) | Tupel containing the command and its optional arguments. |
| -> PhotoSetting | The current settings of the program. |
| -> IO (PhotoSetting, String) | Tupel of the maybe changed settings and a message about the action performed. |
Takes the command the user entered and does some action depeding on it.
Arguments
| :: String | The string the user write on the console. |
| -> (String, String) | Tuple of the command identifier and it optional arguments (maybe an empty string) |
Takes the user input string and split it at the first blank character into the command and its optional argument. If the entered command has no argument the argument string is empty.
Parses a string to a boolean. Accepted are "True" and "true" all other string result in False.
Arguments
| :: String | The file path to be uniformed as a string. |
| -> String | The uniformed file path as a string. |
Brings a given file path to an universal format by replacing backslash with slash and adding a slash at the end of the path if there is no one. If the given file path is an empty string the relativ path of the program "./" is returned.
Arguments
| :: String | The extension to be uniformed as a string. |
| -> String | The uniformed extension as a string. |
Brings a given file extension to an universal format by replacing adding a dot at the beginning if there is no one. If the given extension is an empty string ".*" is returned.